package com.example.hotelsystm.repository;

import com.example.hotelsystm.model.Hotel;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface HotelRepository extends JpaRepository<Hotel, Long> {

    //通过名字来查找学生数据
    @Query("select h from Hotel h where h.roomNo like %:name%")
    List<Hotel> findHotelBy(@Param("name") String name);

}
